package com.tour.service.impl;

import com.tour.dao.IndexMapper;
import com.tour.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @ClassName IndexServiceImpl
 * @Author 张梦兴
 * @Date 2020/3/19 15:20
 * @describe
 */
@Service
public class IndexServiceImpl implements IndexService {
    @Autowired
    private IndexMapper dao;
    @Override
    public Map<String, Object> loadIndex() {
        Map<String, Object> result=new HashMap<>();
        List<Map<String, Object>> hotelInfo = dao.getHotelInfo();
        List<Map<String, Object>> scenicInfo = dao.getScenicInfo();
        List<Map<String, Object>> slidePath = dao.getSlidePath();
        result.put("hotelInfo",hotelInfo);
        result.put("scenicInfo",scenicInfo);
        result.put("slidePath",slidePath);
        return result;
    }

    @Override
    public int insertSlidePath(String fileName) {
        dao.insertSlidePath(fileName);
        return 0;
    }
}
